<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../pages/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>POS收单运营管理平台</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<s:url value="/css/a.css"/>" type="text/css"
	rel="stylesheet" />
<link href="<s:url value="/css/index.css"/>" type="text/css"

	rel="stylesheet" />
	
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.9.1.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>

<script type="text/javascript">
      
      function checkDown(accountNo){
           var checkList="";
            $('[name=userModuleRightCodeList]:checkbox:checked').each(function(){
                 checkList+=$(this).val()+",";
            });
            window.location.href="<%=basePath%>power/editMerchantPower.action?checkList="+checkList+"&merchant.accountNo="+accountNo+"";
      }
      
      function checkShow(){
             $('[name=userModuleRightCodeList]:checkbox').attr("checked",false);
      }
      
      $(document).ready(function(){
		$(":input[name=athorityValue]").each(function(){
		 	var aVal=$(this).val();
		 	$(":checkbox[name=userModuleRightCodeList]").each(function(){
		 		var moduleval=$(this).val();
		 		if(aVal==moduleval){
		 			$(this).attr('checked',true);
		 		}
		 	});
		 	
		 });
		 }
	 );
	 
	 function regist(){
            self.history.back(1);
      };
  </script>



</head>

<body>

	<div class="subpage">
		<s:form id="queryUserForm" namespace="/power" action="search.action" method="post"
			theme="simple">
			<div class="user_title">
				<h2 class="headline-inquires">
					POS收单运营管理平台<br />
					<span class="sub-title"></span>
				</h2>
			</div>	
    
	    <s:iterator value="#request.moduleList" status="stat" id="bean">
	    	<s:hidden name="athorityValue" value="%{#bean.moduleCode}"></s:hidden>
	    </s:iterator>
   	        
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
                        <tr>
                          <th colspan="4">操作权限设置</th>
                        </tr>
    			 </table><br/>
                	
					   <s:iterator value="#request.moduleCateList" id="module">
				             &nbsp;&nbsp;&nbsp;<s:checkboxlist name="userModuleRightCodeList" list="#{#module.moduleCode}"> </s:checkboxlist>
					         <label><s:property value="#module.moduleName"/></label> 
				         </s:iterator> 
					   
                   
                   					  <div align="center"><br/>
                   					  <a href="javascript:checkDown('<s:property value="#request.accountNo"/>')"><b>确定</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <a href="javascript:regist()"><b>返回</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <a href="javascript:checkShow()"><b>重置</b></a>
                   					  </div>
                                      <br/><br/><br/>
                                      
                                      
</s:form>
        </div>
            
    
</body>
</html>
